package com.yqya.springboot.shiro.practice.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yqya.springboot.shiro.practice.dao.UserRelateRoleInfoMapper;
import com.yqya.springboot.shiro.practice.domain.UserRelateRoleInfo;
import com.yqya.springboot.shiro.practice.service.UserRelateRoleInfoService;

/**
 * 用户和角色关联信息服务接口实现类
 *
 * @author Kevin
 * @date 2019-07-28
 */
@Service
public class UserRelateRoleInfoServiceImpl extends ServiceImpl<UserRelateRoleInfoMapper, UserRelateRoleInfo> implements UserRelateRoleInfoService {

    @Override
    public List<UserRelateRoleInfo> listByUserId(Long userId) {
        QueryWrapper<UserRelateRoleInfo> wrapper = new QueryWrapper<>();
        wrapper.eq("user_id", userId);

        List<UserRelateRoleInfo> itemList = list(wrapper);
        return itemList;
    }

}
